package com.hnnou.freshmenappserver.dao;

import com.hnnou.freshmenappserver.bean.Announcement;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AnnouncementDao {
    @Select("select * from t_announcement")
    List<Announcement> findAll();
    @Delete("delete from t_announcement where id=#{id}")
    int deleteById(int id);
    @Update("update t_announcement set  description=#{description} ,date=#{date}  " +
            " where id=#{id} ")
    int update(Announcement announcement);
    @Insert("insert into t_announcement(title, description,date)"+
            " values(#{title},#{description},#{date})")
    int insert(Announcement announcement);

    @Select("select * from t_announcement where id=#{id}")
    Announcement selectById(int id);


}
